
public class p1003_125ms {

	public static//
	// -----
	// -----
	class Main {
		public static void main(String[] args) throws Exception {
			java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
			while (true) {
				float f = Float.parseFloat(reader.readLine());
				if (f == 0)
					return;
				System.out.println(count(f) + " card(s)");
			}
		}

		static int count(float f) {
			float max = 0;
			int i = 1;
			do {
				max += 1f / ++i;
			} while (max < f);
			return i - 1;
		}
	}

	// -----
	// -----

	public static void main(String[] args) throws Exception {
		Judge.run();
	}

}
